import request from '@/utils/request'

// 创建客户
export function createCustomerApi(data) {
	return request({
		url: '/crm/customer/create',
		method: 'POST',
		data: data
	})
}
//获取客户分页
export function getCustomerPageApi(data) {
	return request({
		url: '/crm/customer/page',
		method: 'GET',
		params: data
	})
}
// 获取客户详情
export function getCustomerDetailsApi(id) {
	return request({
		url:`/crm/customer/get?id=${id}`,
		method:'GET'
	})
}
// 更新客户
export function updateCustomerApi(data) {
	return request({
		url: '/crm/customer/update',
		method: 'PUT',
		data: data
	})
}
// 删除客户
export function deleteCustomerApi(id){
	return request({
		url: `/crm/customer/delete?id=${id}`,
		method: 'DELETE'
	})
}
// 暂停/恢复业务合作
export function cooperationApi(data){
	return request({
		url: '/crm/customer/cooperation',
		method: 'PUT',
		data: data
	})
}
// 创建客户开票信息
export function createInvoiceApi(data){
	return request({
		url: '/crm/customer-invoice/create',
		method: 'POST',
		data: data
	})
}
// 获得开票信息
export function getInvoiceApi(id){
	return request({
		url: `/crm/customer-invoice/page?customerId=${id}`,
		method: 'GET'
	})
}

